using System;
using System.Diagnostics;

namespace nToolbox.Data.SQLServer
{
    /// <summary>
    /// Provides basic information about a SQL Server instance
    /// </summary>
    /// <remarks>
    /// The .net 2.0 System.Data..Sql.SqlDataSourceEnumerator Class returns a DataTable, which is fine but 
    /// not always a preferred way of dealing with information
    /// </remarks>
    public class SQLServerInformation
    {

        #region private fields...

        private string _ServerName = string.Empty;
        private string _InstanceName =  string.Empty;
        private bool _IsClustered = false;
        private string _Version = string.Empty;


        #endregion

        #region public properties...

        public string ServerName
        {
            [DebuggerStepThrough]
            get { return _ServerName; }
            [DebuggerStepThrough]
            set { _ServerName = value; }
        }

        public string InstanceName
        {
            [DebuggerStepThrough]
            get { return _InstanceName; }
            [DebuggerStepThrough]
            set { _InstanceName = value; }
        }

        public bool IsClustered
        {
            [DebuggerStepThrough]
            get { return _IsClustered; }
            [DebuggerStepThrough]
            set { _IsClustered = value; }
        }

        public string Version
        {
            [DebuggerStepThrough]
            get { return _Version; }
            [DebuggerStepThrough]
            set { _Version = value; }
        }

        #endregion

        #region constructors...

        /// <summary>
        /// Initializes a new instance of the SQLServerInformation class.
        /// </summary>
        /// <param name="serverName"></param>
        /// <param name="instanceName"></param>
        /// <param name="isClustered"></param>
        /// <param name="version"></param>
        public SQLServerInformation(string serverName, string instanceName, bool isClustered, string version)
        {
            _ServerName = serverName;
            _InstanceName = instanceName;
            _IsClustered = isClustered;
            _Version = version;
        }


        /// <summary>
        /// Initializes a new instance of the SQLServerInformation class.
        /// </summary>
        /// <param name="serverName"></param>
        public SQLServerInformation(string serverName)
        {
            _ServerName = serverName;
        }


        /// <summary>
        /// Initializes a new instance of the SQLServerInformation class.
        /// </summary>
        public SQLServerInformation()
        {
        }

        #endregion

    }
}
